// ECMAScript 2015 (ES6) 提供的 模块化支持

// 按需导入
import { name, show } from './first.js';
console.log( name );
show();

console.log( '- '.repeat(20) );

// 默认导入
import second from './second.js';
console.log( second );

console.log( '- '.repeat(20) );

// 默认导入
import third from './third.js';
console.log( third );

console.log( '- '.repeat(20) );

// 按需导入
import { add as addition, div as divide } from './third.js';

console.log( addition( 1, 9 ) );
console.log( divide( 10, 3 ) );

console.log( '- '.repeat(20) );

import fourth, {add, sub, mult, div } from './fourth.js';
console.log( fourth );

console.log( add(10,20) );
console.log( sub(10,20) );
console.log( mult(10,20) );
console.log( div(10,20) );

console.log( '- '.repeat(20) );

// import * from './fourth.js'; // 非法
// import {*} from './fourth.js'; // 非法
import * as laosi from './fourth.js'; // 合法
console.log( laosi );

console.log( laosi.add( 250, 250 ) );
console.log( laosi.default.name );
console.log( laosi['default'].version );

console.log( '- '.repeat(20) );

import './fifth.js';
$();